	var phoneCheck = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;//手机号正则校验
	var idcardCheck = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; //身份证号正则校验
	
	/*
	 * 非空校验 非空返回true
	 */
	 function checkNotNull(str){
		if(str!=null){
			 str = $.trim(str);//去除前后空格
			 if(str != undefined && str != ""){
				 return true;
			 }else{
				 return false;
			 }
		}else{
			return false;
		}
	}
	
	/*
	 * 返回格式化日期
	 */
	function getStyleDate(dateStr){
		var getWeek = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
		var getDay = ['今天','昨天','前天'];
		var date = dateForIOS(dateStr);
		var mouth = date.getMonth() > 8 ? date.getMonth() + 1 : '0' + (date.getMonth()+1);
		var today = new Date();
		var _mouth = today.getMonth() > 8 ? today.getMonth() + 1 : '0' + (today.getMonth()+1);
		var index = DateDiff(date,  today);
		var head;
		if(index > 2){
			head = getWeek[parseInt(date.getDay()) ];
		}else{
			head = getDay[index];
		}
        return head + ' ' +dateStr;
		// return head + ' ' + date.getFullYear()+'-'+mouth+'-'+date.getDate();
	}
    /*
     * 返回格式化日期
     */
    function getStyleDateTwo(dateStr){
        var getWeek = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
        var getDay = ['今天','昨天','前天'];
        var date = dateForIOSTwo(dateStr);
        var mouth = date.getMonth() > 8 ? date.getMonth() + 1 : '0' + (date.getMonth()+1);
        var today = new Date();
        var _mouth = today.getMonth() > 8 ? today.getMonth() + 1 : '0' + (today.getMonth()+1);
        var index = DateDiff(date,  today);
        var head;
        if(index > 2){
            head = getWeek[parseInt(date.getDay()) ];
        }else{
            head = getDay[index];
        }
        return head + ' ' + date.getFullYear()+'-'+mouth+'-'+date.getDate();
    }
	/*
	 * 适配ios safari 不支持new Date('1000-01-01 12:12:12')的格式
	 */
	function dateForIOS(dateStr){
		var my_time = dateStr.split(/[- : \/]/);
		return new Date(my_time[0], my_time[1]-1, my_time[2], my_time[3], my_time[4], my_time[5]);
	}
    /*
    * 适配ios safari 不支持new Date('1000-01-01 12:12:12')的格式
    */
    function dateForIOSTwo(dateStr){
        var my_time = dateStr.split(/[- : \/]/);
        return new Date(my_time[0], my_time[1]-1, my_time[2]);
    }
	/*
	 *  计算两天之间的天数
	 */
    function  DateDiff(sDate1, sDate2){
    	return parseInt(Math.abs(sDate1  -  sDate2)  /  1000  /  60  /  60  /24)   
    }
	 
	/*
	* 初始化自测页面
	*/
	function testPageInit(){
		var date = new Date();
		var mouth = date.getMonth() > 8 ? date.getMonth() + 1 : '0' + (date.getMonth()+1); // date.getMonth()比实际月份小1
		if($('#testTime').length > 0){
			$('#testTime').text(date.getFullYear()+'-'+mouth+'-'+date.getDate());
		}
		if($('#time1').length > 0){
			divClick('time1','p1');
		}
	}

    function testPageInitTwo(){
        var date = new Date();
        var mouth = date.getMonth() > 8 ? date.getMonth() + 1 : '0' + (date.getMonth()+1); // date.getMonth()比实际月份小1
		var hours=date.getHours();
        var minutes=date.getMinutes();
        var seconds=date.getSeconds();

        rqgs(6);
        if($('#testTime').length > 0){
            $('#testTime').text(date.getFullYear()+'-'+mouth+'-'+date.getDate()+' '+rqgs(hours)+':'+rqgs(minutes)+':'+rqgs(seconds));
        }
        if($('#time1').length > 0){
            divClick('time1','p1');
        }
    }


    function rqgs(s) {
        return s < 10 ? '0' + s: s;
    }
